<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	response.setHeader("Pragma", "No-cache");
	response.setHeader("Cache-Control", "no-cache");
	response.setDateHeader("Expires", 0);
%>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>轮播图编辑</title>
<jsp:include page="../common/top.jsp"></jsp:include>
<script type="text/javascript" src="${path }/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${path }/ueditor/ueditor.all.js"></script>

</head>
<body class="page-content ">
	<div class="page-content-area" data-ajax-content="true">
		<div class="page-header">
			<h1>轮播图编辑</h1>
		</div>
		<div class="row">
			<div class="col-xs-12">
				<form id="_editForm" class="form-horizontal" role="form"
					validate="true" method="post" enctype="multipart/form-data">
					<input type="hidden" name="id" value="${bean.id }" />
					<input type="hidden" name="test" value="test"/>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right">添加图片</label>
						<div class="col-sm-9">
							<div class="clearfix help-validate">
								<img
									<c:if test="${empty bean.imageUrl}"> style="display: none"</c:if>
									alt="上传图片格式出错" src="${bean.imageUrl}"> <input
									type="hidden" name="imageUrl" value="${bean.imageUrl} "
									maxlength="2000"> <input type="button"
									class="form-button-common upload" value="选择图片" /><br /> <br />
								<li style="color: red">必填</li>
							</div>
						</div>
					</div>





					<div class="clearfix form-actions">
						<div class="col-md-offset-3 col-md-9">
							<button id="_submit" class="btn btn-info" type="button"
								data-loading-text="正在提交..." permission="/subject/save">
								<i class="ace-icon fa fa-check bigger-110"></i> 提交
							</button>
						</div>
					</div>


				</form>
			</div>
		</div>
	</div>
	<jsp:include page="../common/bottom.jsp"></jsp:include>
	<script type="text/javascript">
		jQuery(function($) {

			// 提交
			$("#_submit")
					.click(
							function() {
								if ($('#_editForm').validate()) {
									var btn = $(this);
									btn.button('loading');
									$
											.post(
													"${path}/admin/slideShow/save",
													$.formJson('_editForm'),
													function(d) {
														if (d) {
															btn.button('reset');
															if (d.status == '0000') {
																$(
																		'input[name="id"]')
																		.val(
																				d.data.id);
																window.location.href = '${path}/admin/slideShow';
															} else {
																$.gritter
																		.add({
																			text : d.message
																		});
															}
														}
													}, 'json');
								}
							});

		});
	</script>




</body>
</html>

